/*
 * @Author: cl
 * @Description:
 * @Date: 2023-04-18 11:13:29
 * @LastEditTime: 2023-04-20 10:18:13
 * @FilePath: \jsnode\nestjs\naota\src\subject\subject.controller.ts
 * @LastEditors: cl
 */
import { Controller, Get, Post, Body, Patch, Param, Delete } from '@nestjs/common'
import { SubjectService } from './subject.service'
import { CreateSubjectDto } from './dto/create-subject.dto'
import { UpdateSubjectDto } from './dto/update-subject.dto'
import { ApiTags } from '@nestjs/swagger'

@Controller('subject')
@ApiTags('科目')
export class SubjectController {
  constructor(private readonly subjectService: SubjectService) {}

  @Post()
  create(@Body() createSubjectDto: CreateSubjectDto) {
    return this.subjectService.create(createSubjectDto)
  }

  @Get("findAll")
  findAll() {
    return this.subjectService.findAll()
  }

  @Get(':id')
  findOne(@Param('id') id: string) {
    return this.subjectService.findOne(+id)
  }

  @Patch(':id')
  update(@Param('id') id: string, @Body() updateSubjectDto: UpdateSubjectDto) {
    return this.subjectService.update(+id, updateSubjectDto)
  }

  @Delete(':id')
  remove(@Param('id') id: string) {
    return this.subjectService.remove(+id)
  }
}
